<?php

namespace app\config\models;

class PermalinkForm extends BaseConfig {

    public static $structures = [
        "0" => ["默认", "/?p=123"],
        "1" => ["Id型", "/type/id"],
        "2" => ["Slug型", "/type/slug"],
        "3" => ["名称型", "/type/name"]
    ];

    public $permalinkStructure;

    public function rules() {
        return [
            [
                [
                    'permalinkStructure',
                ],
                'required'
            ],
        ];
    }

    public function attributeLabels() {
        return [
            'permalinkStructure' => '链接结构',
        ];
    }

    public function loadDefaultValues() {

    }

    public function save($runValidation = true, $attributeNames = null) {
        if ($runValidation && !$this->validate($attributeNames)) {
            return false;
        }
        return true;
    }
}